import React, { Component, Fragment } from 'react';
import { Breadcrumb } from 'antd';
import { connect } from 'dva'

class CurrentLocation extends Component{
    constructor(props){
        super(props)
    }

    breadReplacePage = url => {
        this.props.dispatch({
            type:'app/appMenuReplacePage',
            data:url
        })
    }

    render(){
        return(
            <Breadcrumb style={{marginTop:10}}>
                {this.props.breadArr.map((item,index) => {
                    return(
                        <Breadcrumb.Item onClick={()=>{this.breadReplacePage(item.url)}}>{item.title}</Breadcrumb.Item>
                    )
                })}
            </Breadcrumb>
        )
    }
}

export default connect()(CurrentLocation)